﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Samples.SimpleStreaming.Agent;
using Microsoft.Phone.BackgroundAudio;

namespace Samples.SimpleStreaming {
    public partial class Settings : PhoneApplicationPage {
        Samples.SimpleStreaming.Agent.SimpleAudioPlayerService.Options o;

        public Settings() {
            InitializeComponent();
            o = SimpleAudioPlayerService.Options.LoadOptions();
            WiFi_Only.IsChecked = o.WiFiAndEthernetOnly;

        }


        private void SaveSettings_Click(object sender, System.EventArgs e)
        {
            o.WiFiAndEthernetOnly = (bool)WiFi_Only.IsChecked;
            o.SaveOptions(o);
            BackgroundAudioPlayer.Instance.Stop();
        }


    }
}